#!/usr/bin/env python3.3

#
#  Filename: e40.py
#  Author  : lukas singer
#
#  Comment : Created by createSolution.sh
#

#import euler
#from euler import *

def pe40():
  s=''
  i=1
  while len(s)<1000001:
    s+=str(i)
    i+=1
  print(int(s[0])*int(s[9])*int(s[99])*int(s[999])*int(s[9999])*int(s[99999])*int(s[999999]))

if __name__=="__main__":
  pe40()

